Binary image scaling by piecewise polynomial interpolation

ABSTRACT

A piecewise polynomial interpolation scheme treats images as three-dimensional data in which the X and Y coordinates are the input image dimensions, and the Z coordinate is the intensity of the image. The three-dimensional data set is fitted by a surface, and a resampling process on the fitting surface provides interpolative data. A thresholding process applied on these interpolative data produces a final image output. Based on the interpolating scheme, each output pixel is a weighted average of its neighboring pixels, with weights determined by the type of the interpolant, its degree, and the desired scaling factor. The weights may be pre-calculated for fixed scaling factors, such that the convolution is accomplished by table lookup. Additionally, the resampling process may include a phase shifting to realign said sampling location with respect to an input image.

BACKGROUND OF THE INVENTION

1. Technical Field

The present invention relates to scaling binary images. Moreparticularly, the present invention relates to binary image scaling bypiecewise polynomial interpolation.

2. Description of the Prior Art

When scaling a binary image, it is necessary to resolve the discrepancybetween the input resolution and the output resolution. For example, infacsimile imaging the original images are transmitted at a standardresolution, typically 203 dots per inch ("dpi") in the row direction and98 dpi in the column direction, and printed at the printer resolution,e.g. 300 dpi, in both the row and column directions. Another example ofbinary imaging involves font scaling, for example when a 12 point fontat 300 dpi is to be used as a 24 point font and printed on a 600 dpiprinter, the original image must be scaled by a factor of four. Thus,the scaling factor can be an integer or a fractional number.

One approach to image scaling is to apply piecewise polynomialinterpolation such as B-splines, as proposed in R. V. Klassen, R. H.Bartels, Using B-splines for Re-Sizing Images, University of Waterloo,Department of Computer Science, Technical Report, 1986. However, suchapproach has not proven satisfactory.

A quantization error problem embedded in all piecewise polynomialinterpolants for scaling was reported in I. E. Abdou and K. Y. Wong,Analysis of Linear Interpolation Schemes for Bi-Level ImageApplications, IBM J. Res. Develop., V. 26, No. 6, pp. 667-680, November,1982. Thus, interpolation schemes give rise to a quantization errorproblem, such that the image stroke width is not preserved after imagescaling.

Other known approaches for scaling and smoothing images includepixel-replication, contour-tracing (see W. Rutkowski, Shape Completion,Computer Graphics and Image Processing, Vol. 9, pp. 89-101, 1979), cubicB-spline interpolation (see H. S. Hou, H. C. Andrews, Cubic Splines forImage Interpolation and Digital Filtering, IEEE Transaction on Acoustic,Speech and Signal Processing, Vol. ASSP-26, pp. 508-517), template basedscaling (see R. A. Ulichney, D. E. Troxel, Scaling Binary Images withthe Telescoping Template, IEEE Transactions on Pattern Analysis andMachine Intelligence, Vol. PAMI-4, No. 3, pp. 331-335, 1982), andextrapolative prediction (see C. Tung, Resolution Enhancement Technologyin Hewlett Packard Laser Jet Printers, IST/SPIE Symposium on ElectronicImaging: Science and Technology, pp. 440-448, 1993).

There is not known a satisfactory and flexible scheme based on automaticnumerical computation for binary image scaling that is general enoughfor all integer and fractional scaling factors, while avoidingquantization problems typically encountered in prior art approachesusing piecewise polynomial interpolants.

SUMMARY OF THE INVENTION

The exemplary embodiment of the invention is based on a piecewisepolynomial interpolation scheme. The scheme views images asthree-dimensional data in which the X and Y coordinates are the inputimage dimensions, and the Z coordinate, i.e. the height field, is theintensity of the original image. The three-dimensional data set isfitted by a surface. A resampling process on this fitting surfaceprovides interpolative data. A thresholding process applied on theseinterpolative data produces an output, i.e. a final binary image. Basedon the interpolation scheme, each output pixel is a result of blendingits neighboring input pixels, i.e. it is a weighted average, withweights determined by the type of the interpolant, its degree, and thescaling factor. For fixed scaling factors, the weights can bepre-calculated, and the convolution can be accomplished by table lookup.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a flow diagram showing a process path for an exemplaryembodiment of the invention;

FIG. 2 shows a test character in 20 point, 300 dpi, Times Font;

FIG. 3 is a wireframe representation of the input coefficients for thetest character of FIG. 2;

FIG. 4 shows a bi-linear tensor product B-spline surface defined by theinput data of the test character of FIG. 2;

FIG. 5 shows a bi-quadratic tensor product B-spline surface defined bythe input data of the test character of FIG. 2;

FIG. 6 shows a bi-cubic tensor product B-spline surface defined by theinput data of the test character of FIG. 2;

FIG. 7 shows a bi-linear interpolation of the test character of FIG. 2;

FIG. 8 shows a bi-quadratic interpolation of the test character of FIG.2;

FIG. 9 shows a bi-cubic interpolation of the test character of FIG. 2;

FIG. 10 shows an undershot quantization error;

FIG. 11 shows an overshot quantization error;

FIG. 12 shows the impulse response of a cubic B-spline;

FIG. 13 shows the impulse response function of a cubic B-spline sampledat 0, 1/3, and 2/3;

FIG. 14 shows the impulse response of a quadratic B-spline;

FIG. 15 shows the impulse response function of a quadratic B-splinesampled at 0, 1/3 and 2/3;

FIG. 16 shows a phase shift by one half of the spacing during samplingto compensate for phase distortion;

FIG. 17 shows an image that results from the phase shift of FIG. 16;

FIG. 18 shows the impulse response of a quadratic B-spline interpolantafter sampling at 0 and 1/2;

FIG. 19 shows the impulse response of a cubic B-spline interpolant aftersampling at 0 and 1/2;

FIG. 20 shows quantization error for a bi-quadratic B-spline interpolantafter sampling at 0 and 1/2, as shown in FIG. 18;

FIG. 21 shows quantization error for a bi-cubic B-spline interpolantafter sampling at 0 and 1/2, as shown in FIG. 19;

FIG. 22 shows the impulse response of a quadratic Beta-spline;

FIG. 23 shows an image that results from interpolating by a bi-quadraticBeta-spline;

FIG. 24 shows the impulse response of a cubic Beta-spline;

FIG. 25 shows an image that results from interpolating by a bi-cubicBeta-spline;

FIG. 26 shows an image that results from interpolating by a shiftedbi-quadratic B-spline;

FIG. 27 shows an image that results from interpolating by a shiftedbi-cubic B-spline;

FIG. 28 shows a portion of a Slerexe letter in standard resolution;

FIG. 29 shows a portion of a Slerexe letter in fine resolution;

FIG. 30 shows a character cropped from a Slerexe letter;

FIG. 31 shows an image that results from applying a bi-cubic B-splinesurface as an interpolant for scaling horizontally and vertically by afactor of 3.0 in fine resolution;

FIG. 32 shows the result of applying a quadratic-by-quartic tensorproduct B-spline surface as an interpolant for scaling horizontally by afactor of 3.0 and vertically by a factor of 1.5 in standard resolution;

FIG. 33 shows a test character in the original 12 point font at 300 dpi;

FIG. 34 shows the test character of FIG. 33 scaled two times by RET; and

FIG. 35 shows the test character of FIG. 33 scaled by bi-septimalB-splines.

DETAILED DESCRIPTION OF THE INVENTION

The exemplary embodiment of the invention is based on a piecewisepolynomial interpolation scheme (see J. Yen, Binary Image Scaling byPiecewise Polynomial Interpolation, HPL Technical Report, March, 1994).The invention applies a surface based approach to image scaling, asopposed to prior art contour-tracing schemes.

Image scaling in accordance with the invention herein is not limited tocubic transforms, as described in H. S. Hou, H. C. Andrews, CubicSplines for Image Interpolation and Digital Filtering, IEEE Transactionon Acoustic, Speech and Signal Processing, Vol. ASSP-26, pp. 508-517.However, the exemplary embodiment of the invention does share somefeatures with the template based approaches of R. A. Ulichney, D. E.Troxel, Scaling Binary Images with the Telescoping Template, IEEETransactions on Pattern Analysis and Machine Intelligence, Vol. PAMI-4,No. 3, pp. 331-335, 1982; and C. Tung, Resolution Enhancement Technologyin Hewlett Packard LaserJet Printers, IST/SPIE Symposium on ElectronicImaging: Science and Technology, pp. 440-448, 1993. Although theinvention differs from such prior art approaches because it derivestemplates mathematically from surface geometry rather than byinterpretation or extrapolation by analysis of each individual case.Therefore the templates herein may be numerically fine-tuned for printquality control, as may be required, or as are consistent with, variousselected design parameters.

FIG. 1 is a flow diagram showing a process path for an exemplaryembodiment of the invention. The invention provides a scheme that treatsbinary images as three-dimensional data in which the X and Y coordinatesare the input image (110) dimensions, and the Z coordinate, i.e. theheight field, is the intensity of the original image. Thisthree-dimensional data set is fitted by a surface (120). A resamplingprocess (130) on the fitting surface provides interpolative data. Athresholding process (140) is applied to the interpolative data toproduce an output binary image (150). Based on this interpolationscheme, each output pixel is a result of blending its neighboring inputpixels, i.e. each output pixel is a weighted average of its neighboringpixels, with weights determined by the type of the interpolant, itsdegree, and the desired scaling factor. In one embodiment of theinvention, the weights can be pre-calculated for fixed scaling factors,such that the convolution can be accomplished by table lookup.

An Interpolation Method.

The exemplary embodiment of the invention provides a scheme that employsa piecewise polynomial, for example, B-splines, as the fittinginterpolant to the original data (see W. J. Gordon and R. F. Riesenfeld,B-spline Curves and Surfaces in R. E. Barnhill and R. F. Riesenfeld(eds.), Computer Aided Geometric Design, Academic Press, New York, 1974,pp. 95-126).

A Curve ##EQU1## is a uniform polynomial B-spline curve in parametertε(0,1), where B_(i),k (t) are the spline basis, of order k (degreek-1), and p_(i) are the input coefficients. In product form,

    γ(t)=BP                                              (2)

where

    B=[B.sub.0,k (t) B.sub.1,k (t) . . . B.sub.k-1,k (t)]      (3)

and

    P=[p.sub.0 p.sub.1 . . . p.sub.k-1 ].sup.T.                (4)

EXAMPLE 1

A cubic uniform polynomial B-spline curve,

    γ(t)=[B.sub.0,4 (t) B.sub.1,4 (t) B.sub.2,4 (t) B.sub.3,4 (t)][p.sub.0 p.sub.1 p.sub.2 p.sub.3 ].sup.T,             (5)

is an inner product of four input coefficients p_(i) 's and the cubicspline basis B_(i),4 (t)'s evaluated at t between [0, 1).

Marsden's Identity

It can be proven (see L. Schumaker, Spline Functions: Basic Theory,Wiley, New York, 1981) that for each spline basis of order k,

    B=[B.sub.0,k (t) B.sub.1,k (t) . . . B.sub.k-1 (t)]        (6)

there exists a basis translation matrix (k by k)M_(k), such that

    B=TM.sub.k                                                 (7)

where T_(k) is the power basis,

    [t.sup.k-1 t.sup.k-2 . . . t 1].                           (8)

Since γ(t)=BP, therefore,

    γ(t)=TM.sub.k P.                                     (9)

EXAMPLE 2

Given input coefficients, p₀, p₁, p₂, and p₃, a cubic uniform polynomialB-spline curve t is defined as

    γ(t)=[t.sup.3 t.sup.2 t 1]M.sub.4 [p.sub.0 p.sub.1 p.sub.2 p.sub.3 ],tε[0,1)                                         (10)

where the basis translation matrix is ##EQU2## (see J. D. Foley, A. vanDam, S. K. Feiner, J. F. Hughes, Computer Graphics, Principles andPractice, Second Edition, Addison Wesley, 1990).

The basis translation matrices for other degrees, from linear throughseptimal, are described below. For more than k order input coefficients,every k consecutive coefficients define one piece of the curve segmentsuch that the total curve consists of these curve segments and is thuscalled a piecewise B-spline curve. For a piecewise uniform polynomialB-spline curve, all the curve segments are connected smoothly, i.e. withC^(k-1) continuity at segment joints.

A surface ##EQU3## is a uniform polynomial B-spline tensor productsurface in parameters uε[0,1) and vε[0,1), where:

B's are the spline basis, of order k_(u) in direction U;

A's are the spline basis, of order k_(v) in direction V; and

p_(i),j 's are the two-dimensional input coefficients.

Thus, s(u,v)=BPA^(T), similar to the curve case, A=UM_(k).sbsb.u,A=VM_(k).sbsb.v, and A^(T) =M_(k).sbsb.v^(T) V^(T) where U is the powerbasis in u; V is the power basis in v; and M's are the basis translationmatrices.

Therefore,

    s(u,v)=UM.sub.k.sbsb.u PM.sub.k.sbsb.v.sup.T V.sup.T.      (13)

EXAMPLE 3

A bi-cubic uniform polynomial B-spline tensor product surface

    s(u,v)=UM.sub.4 PM.sub.4.sup.T V.sup.T                     (14)

where M₄ is the basis translation matrix of order 4, as shown above inExample 2.

EXAMPLE 4

FIG. 2 shows a test character in 20 point, 300 dpi, Times Font. FIG. 3is a wireframe representation of the input coefficients for the testcharacter of FIG. 2.

FIG. 4 shows a bi-linear tensor product B-spline surface defined by theinput data of the test character of FIG. 2; FIG. 5 shows a bi-quadratictensor product B-spline surface defined by the input data of the testcharacter of FIG. 2; and FIG. 6 shows a bi-cubic tensor product B-splinesurface defined by the input data of the test character of FIG. 2.

FIG. 7 shows a bi-linear interpolation of the test character of FIG. 2;FIG. 8 shows a bi-quadratic interpolation of the test character of FIG.2; and FIG. 9 shows a bi-cubic interpolation of the test character ofFIG. 2. In each of the foregoing figures, The letter "W" is shown as aseries of steps in which the lower right hand letter includes missingportions of the letter after scaling, indicated by small solid squares,and added portions of the letter after scaling, indicated by smallhollow squares. Notice that the result of bi-linear interpolationappears to be blocky, while the results of higher order interpolationare usually smoother.

B-splines as Convolution Kernels

Once the order of the interpolating surface is determined, theresampling process on the fitting surface evaluates the piecewisepolynomial surface at a set of appropriate locations, one piece at atime.

For scaling by a factor of M in the U direction, the evaluationlocations are selected between [0,1) with even spacing, usually0,1/M,2/M, . . . , ##EQU4## in the U direction.

For scaling by a factor of N in the V direction, the evaluationlocations are selected between [0,1) with even spacing, usually0,1/N,2/N, . . . , ##EQU5## in the V direction.

Since each piece of the surface is defined by the k_(u) by k_(v)consecutive input coefficients, resampling involves evaluating ##EQU6##

For each known (u₀,v₀) pair, UM_(k).sbsb.u and M_(k).sbsb.v^(T) V^(T)can be pre-calculated as vectors, ξ and .o slashed., respectively. Ak_(u) by k_(v) matrix, called the Kernel Matrix, can be constructed bymultiplying ξ and .o slashed., i.e.

    Kij=ξ.sub.i .o slashed..sub.j.                          (16)

The coefficient matrix P is also k_(u) by k_(v). The sum of theentry-by-entry product of P and K is the result of the surface evaluatedat u₀ and v₀, ##EQU7##

The kernel matrix is constructed for each (u,v) pair.

Finally, a threshold value is selected to compare against the numericvalues, s(u,v)'s, to obtain the binary data of the output pixels.

EXAMPLE 5

To scale an image by a factor of 3 with a bi-cubic uniform piecewiseB-spline tensor product surface, s(u,v), for each 4 by 4 input pixels,e.g. ##EQU8## a kernel matrix is calculated for each of the following 3by 3 output pixels: ##EQU9##

For instance, for the upper left corner of the 9 output pixels,s(u₀,v₀), where u₀ =0.0 and v₀ =0.0, U=u³ u² u 1.0]=[0.0 0.0 0.0 1.0],and ##EQU10## Therefore, ##EQU11##

Similarly, ##EQU12## and ##EQU13##

The kernel matrix for s (0.0,0.0) can be calculated by multiplyingentries of (UM) with (M^(T) V^(T)), i.e. ##EQU14##

Finally, the sum of the entry-to-entry product of P and K, ##EQU15## isa numeric value representing the point on the surface after resampling.The final quantization step compares this numeric value against apre-selected threshold value to produce a binary value representing theupper-left corner of the output binary image.

The kernels for the other s(u,v)'s are listed below.

B-spline Characteristics

There are many advantageous mathematical characteristics of B-splines.Some of the advantages of using B-splines as interpolants for binaryimage scaling are listed below:

Continuum. The fitting surface, i.e. a B-spline surface, is a continuumcovering the entire input data. Accordingly, the resampling processalways produces at least a few points on the surface, regardless of thearbitrariness of the scaling factors. Thus, this interpolating method isapplicable for any arbitrary scaling factor.

Convex Hull Property. A B-spline tensor product surface is alwayscontained in the convex hull formed by its input data mesh. Thus, allthe output data produced from the resampling process are always boundedby the input data.

Continuity. A B-spline tensor product surface is C^(k-1) continuous ineach parametric direction, where k is the order. Thus, the interpolateddata are smooth. If a higher order interpolant is used, the edges of theoutput image are smoother.

Locality. Each point on the B-spline tensor product surface depends onlyon a finite number of input data points, k_(u) by k_(v), where k's arethe orders of the surface. Thus, the convolution kernel size of eachoutput pixel is no more than k_(u) by k_(v).

Separability. The surface evaluation process of a B-spline tensorproduct surface may be totally independent from one parametric directionto the other. Accordingly, this interpolation scheme works for differentscaling factors in the two orthogonal directions. In addition, the orderof one direction is totally independent from the order of the otherdirection. Thus, the selection of the interpolant orders may be asarbitrary as required.

Symmetry. All the B-spline basic functions are symmetric and theirimpulse response functions are also symmetric.

Computational Complexity

The complexity of the scheme herein described is linear in the inputsize because it has a fixed number of operations per pixel. The schememay be thought of as constant filtering with a set of k_(u) by k_(v)convolution kernels, where k's are the orders, i.e. degrees plus one, ofthe fitting surface. The number of the filters is at most M*N, where Mand N are the scaling factors in the horizontal and vertical directions,respectively.

The filtering process of the scheme described herein depends only on thescaling factor, the orders of the fitting surface, and the thresholdvalue. Therefore, after the filter parameters are finalized, a templatescheme may easily be implemented by pattern matching and table lookup.

The lookup table size may be up to about 2^(k).sbsp.u^(k).sbsp.v *M*Nbits. However, much reduction in table size may be achieved by using themathematical properties of B-splines. For example, when scaling by afactor of 3 with a bi-cubic uniform piecewise B-spline tensor productsurface, the upper bound of the space complexity is 2^(4*4) *3*3 bits.That is, for each of the 9 output pixels, there is a table of 16entries, as described below.

Locality. Upon close examination, it can be seen that not all of the 9output pixels have 16 entries. For example, the convolution kernels ofmany output pixels have all 0's for the rightmost column or thebottommost row. The complexity of the lookup tables can therefore bereduced to 2⁹ +2¹² *4+2¹⁶ *4 bits.

Symmetry. If one looks even more closely, one can also discover thatthere is some symmetry in the numeric values in the convolution kernels.For example, the kernels ##EQU16## have similar rows or columns exceptthe numbers are row-permutations or column-permutations of each other.Similar relationships hold for ##EQU17## Thus, the space complexity ofthe lookup tables can be further reduced to 2⁹ +2¹² +2¹⁶ bits, if someprocessing capability is provided.

Dominancy. Some entries of the convolution kernels are more dominantwith regard to the resulting output than are other entries. A finalthresholding process is applied for binary image scaling. Many entriesof the kernels become insignificant because of this quantizationprocess. For example, if the threshold value is chosen as 16/32 for theabove case, then in kernel of s (0,0), those entries with value 1/36 areeffectively "don't-cares" because they never contribute to the finalresult in any significant way. For practical purposes, the variousimplementations of the invention may be optimized by keeping only themost dominant entries of kernels. In this way, one may fine tune theinvention for each specific application by balancing between a practicaltable size and a desired print quality.

In summary, the lookup table size can be significantly reduced dependingon the design constraints in memory limitation and processor speed.

A Quantization Error Problem

For scaling binary images, it is important to preserve the stroke width.That is, when a single pixel line is scaled by a factor of N, the outputpixel line must have a width N. Sometimes the stroke width is notpreserved if errors are produced from the quantization step of thescaling algorithm, for example when a single pixel line is scaled by afactor of 3 by means of a bi-quadratic B-spline interpolant.

FIG. 10 shows an undershot error in quantization with threshold valueH=0.5; and FIG. 11 shows an overshot error in quantization withthreshold value H=0.5+1.0e⁻⁶. No matter how one adjusts the thresholdvalue, the scaled image either consistently has an extra pixel line, orit has one less pixel line than the pixel replication. Similar errorsoccur when a single pixel line is to be scaled by a factor of 2 by meansof a bi-cubic B-spline interpolant.

The quantization error problem was reported in I. E. Abdou and K. Y.Wong, Analysis of Linear Interpolation Schemes for Bi-Level ImageApplications, IBM J. Res. Develop., V. 26, No. 6, pp. 667-680, November,1982, and was believed to be caused by the lack of symmetry of all theeven degree polynomials. However, as shown above, the quantization erroroccurs regardless of the degree of the interpolant.

For example, FIG. 12 shows the impulse response of a cubic B-spline,while FIG. 13 shows the response function sampled at 0, 1/3, and 2/3.The peak of the response function, representing the input data point, isincluded in the resampled data. In contrast thereto (see FIGS. 14 and15), when scaling by 3 with a quadratic B-spline interpolant, the peakof the response function is not included in the resampled data. Thisresults because of sampling the interpolant at the locations, 0,1/N, . .. , ##EQU18## This phenomenon has been described as the phase distortionproperty of all the even degree polynomials (see I. E. Abdou and K. Y.Wong, Analysis of Linear Interpolation Schemes for Bi-Level ImageApplications, IBM J. Res. Develop., V. 26, No. 6, pp. 667-680, November,1982).

As shown in FIG. 16, the phase could be shifted by one half of thesampling spacing, e.g. by 1/6, to compensate for such phase distortion.FIG. 17 shows the result of such an adjustment, having a threshold valueH=0.56. It can be seen that for odd scaling factors, when compared tothe situations shown in FIGS. 10 and 11, B-spline interpolants, whetherof even degree or of odd degree, do not suffer quantization errors ifthe phase is not distorted.

However, for even scaling factors, all B-spline interpolants, regardlessof whether they are of even degree or of odd degree, are subject to aquantization error, even if phase is not distorted. For example, FIG. 18shows the impulse response of a quadratic B-spline interpolant aftersampled at 0 and 1/2, i.e. a scaling factor of 2; and FIG. 19 shows theimpulse response of a cubic B-spline interpolant after sampled at 0 and1/2. In both cases, there is no phase distortion. Nevertheless,quantization errors occur in both cases, as shown in FIGS. 20 and 21.This quantization error is caused by a lack of symmetry of theinterpolant. That is, in the absence of phase distortion, the peak ofthe impulse response is always sampled, while the rest of the sampleddata points are always symmetric. Hence, when the thresholding steptakes place, the result always contains an odd number of output pixels.

One aspect of the invention solves the quantization error problem causedby a lack of the symmetry of the impulse response of B-splineinterpolant when even scaling factors are applied. In one embodiment ofthe invention, one aspect of this solution enlarges the search spacefrom the space spanned by B-splines, which is equivalent to the spacecontaining all the piecewise polynomials, to the space spanned by theBeta-spline, which is a more generalized form of splines (see A. Lempeland G. Seroussi, Systematic derivation of spline bases, Computer AidedGeometric Design, 9 (1992), pp. 349-363; and G. Seroussi and B. Barsky,An explicit derivation of discretely shaped Beta-spline basis functionsof arbitrary order, Mathematical Methods in Computer Aided GeometricDesign II, T. Lyche and Larry Schumaker (eds.), pp. 567-584, 1992).

The use of enlarged search space is derived in part from the fact thatthe impulse response of a Beta-spline is usually not symmetric. FIG. 22shows the impulse response of a quadratic Beta-spline with β₁ =1.3, andFIG. 23 shows the result of using this interpolant with threshold valueH=0.56; while FIG. 24 shows the impulse response of a cubic Beta-splinewith β₁ =2.0, β₂ =-0.5, and FIG. 25 shows the result of using thisinterpolant with the threshold value H=0.52. Unfortunately, theforegoing solutions to the quantization error problem still produce ascaled output image that is missing at least one pixel in horizontal runlength.

Another aspect of the invention with regard to a solution to thequantization error problem overcomes the symmetry of the impulseresponse by shifting the phase of the basis function. FIG. 26 shows theresult of interpolation by a bi-quadratic B-spline with phase shiftδ=0.1 and threshold value H=0.56, while FIG. 27 shows the result ofinterpolation by a cubic B-spline with phase shift δ=0.1 and thresholdvalue H=0.56. The actual amount of phase shifting used is a function ofthe application to which the invention is put.

Another aspect of the invention with regard to a solution to thequantization error problem combines the two techniques described above,i.e. it uses a phase shifted, Beta-spline interpolant.

Applications

The scheme described herein was applied to two major application areas,e.g. facsimile imaging and font scaling. It should be appreciated thatthe invention is not limited to these two example applications.

For facsimile imaging in standard mode, the input images are transmittedin standard facsimile resolutions of 203 dpi horizontally and 98 dpivertically. FIG. 28 shows a portion of the Slerexe letter in standardresolution. In fine mode, the vertical resolution is 196 dpi; FIG. 29shows a portion of the Slerexe letter in fine resolution.

At the receiving end of the facsimile transmission, printer resolutionis typically 300 dpi both ways, 600 dpi horizontally and 300 dpivertically, or 600 dpi both ways. Therefore, for facsimile imaging thescaling factors are usually fixed numbers. However, because ofcomplications associated with the physical constraints in printablemargins of the facsimile printing mechanism, the scaling factor is notactually 300/203 or 300/98. Instead, the scaling factors are rounded offto 3/2 or 3/1 (i.e. 1.5 or 3.0) by padding with extra pixels to fill inthe differences encountered in various firmware implementations.

In addition to binary image scaling, the invention may also be used forimage smoothing to remove the aliasing artifacts, as is required infacsimile imaging. FIG. 30 shows a character cropped from the Slerexeletter. The aliasing artifacts shown in the figure include staircases,edge ticks, and stray dots. As a result of applying a bi-cubic tensorproduct B-spline surface as an interpolant in accordance with theinvention herein, the staircases are smoothed, the number of stray dotsis reduced, and edge ticks are increased in run length and lowered inheight. In fact, stray dots may be detected and totally removed by theinvention, if so desired.

FIG. 31 shows the results of applying a bi-cubic B-spline surface as aninterpolant for scaling horizontally and vertically by a factor of 3.0in fine resolution. If it is necessary or desirable to compensate forthe 2:1 aspect ratio used in standard resolution, a different order inhorizontal direction may be chosen from that of the vertical directionof the fitting surface. FIG. 32 shows the result of applying aquadratic-by-quartic tensor product B-spline surface as an interpolantfor scaling horizontally by a factor of 1.5 and vertically by a factorof 3.0 in standard resolution.

The invention may also be used to scale English character fonts. Forexample, to scale a 12 point font in 300 dpi to a 24 point font forprinting on a 600 dpi printer requires scaling by a factor of 4 in boththe horizontal and the vertical directions. FIG. 33 shows a testcharacter in the original 12 point font in 300 dpi.

The test character of FIG. 33 may be scaled by twice applying RET(Resolution Enhancement Technology), which uses a set of diamond shapedtemplates (see C. Tung, Resolution Enhancement Technology in HewlettPackard LaserJet Printers, IST/SPIE Symposium on Electronic Imaging:Science and Technology, pp. 440-448, 1993). FIG. 34 shows the resultsobtained using this approach. In the figure, it can be seen thatartifacts 34 have been introduced along the inside curved portion of thetest character at lower right corner by this approach.

One embodiment of the invention that was applied to the test characterinvolved interpolating by a bi-septimal tensor product B-spline surfaceusing a rectangular template. This approach removes the artifacts, ascan be seen in FIG. 35.

Basis Translation Matrices

For each spline basis of order k,

    B=[B.sub.0,k (t) B.sub.1,k (t) . . . B.sub.k-1,k (t)],     (28)

there exists a basis translation matrix (k by k) M_(k), such that

    B=TM.sub.k                                                 (29)

where T_(k) is the power basis,

    [t.sup.k-1 t.sup.k-2 . . . t 1].                           (30)

Listed below are basis translation matrices for uniform polynomialB-splines of orders linear through septimal. ##EQU19##

Sample Convolution Kernels

Listed below are convolution kernels for scaling by a factor of 3 with abi-cubic uniform polynomial B-spline tensor product surface, s(u,v).K^(u).sbsp.0.sup.,v.sbsp.0 is the kernel for sampling s (u,v) at (u₀,v₀). ##EQU20##

Accordingly, the invention provides an image scaling method that isbased on piecewise polynomial interpolation. The invention may be usedfor arbitrary or fixed scaling factors, and it may also be used toreduce or remove aliasing artifacts.

The invention described herein has at least the following advantages:

It is a formal model that provides a systematic way of generatingconvolution kernels for image scaling that are useful for solving thequantization error problem that affects all polynomial interpolants.

It provides a scheme that determines numeric values that are used tocontrol the weights of the neighboring input pixels. By adjusting themathematical computations applied by the invention, the specificimplementation of the invention may be fine tuned for the best printquality, subject to various design parameters, such as pen, ink, paper,carriage speed, and ROM size.

It provides a table lookup scheme suitable for hardware implementationusing known hardware techniques. The lookup table size may besubstantially reduced to meet the memory space constraints.

Although the invention is described herein with reference to thepreferred embodiment, one skilled in the art will readily appreciatethat other applications may be substituted for those set forth hereinwithout departing from the spirit and scope of the present invention.Accordingly, the invention should only be limited by the claims includedbelow.

I claim:
 1. A computer-implemented method for binary image scaling bypiecewise polynomial interpolation within the memory of a computerdevice, comprising the steps of:modeling binary data representing aninput pixel image as a three-dimensional data set comprising X, Y, Z, inwhich the X and Y coordinates are input pixel image dimensions, and theZ coordinate is the intensity of the original pixel image; fitting saidthree-dimensional data set by a surface interpolant; determining thetype and the degree of the piecewise polynomial interpolant for surfacefitting based on the image scaling factor; resampling said binary datarepresenting said input pixel image on said fitting surface to provideinterpolative data; correcting for any quantization error problems insaid interpolative data, if necessary; thresholding said interpolativedata to produce binary data representing an output pixel image; andproducing said output pixel image, wherein said output pixel image isscaled from said input pixel image.
 2. The method of claim 1, whereinsaid interpolant is a B-spline tensor product surface.
 3. The method ofclaim 1, wherein said interpolant is a Beta-spline tensor productsurface.
 4. The method of claim 1, further comprising the steps of:phaseshifting during said resampling step to realign said sampling locationwith respect to said scaling factor.
 5. The method of claim 4, furthercomprising the step of:determining the amount of phase shifting forsolving the quantization error problem.
 6. The method of claim 1,further comprising the step of:determining threshold values that areused to produce binary output pixels.
 7. The method of claim 1, furthercomprising the steps of:determining values that are used to controlweights of neighboring input pixels; pre-calculating said weights forfixed scaling factors; and performing a convolution by table lookup. 8.The method of claim 7, further comprising the step of:fine tuning saidtable lookup.
 9. The method of claim 8, further comprising the stepsof:reducing table lookup size by the locality detected in saidconvolution kernels; reducing table lookup size by the symmetry detectedin said convolution kernels; and reducing table lookup size by keepingonly the most dominant entries of the convolution kernels.
 10. Themethod of claim 8, further comprising the step of:manually modifying theentries of the lookup table, whereby aliasing artifacts aresubstantially removed.
 11. A computer device-implemented system forbinary image scaling by piecewise polynomial interpolation,comprising:an input module for receiving binary data representing aninput pixel image as a three-dimensional data set comprising X, Y, Z, inwhich the X and Y coordinates are input pixel image dimensions, and theZ coordinate is the intensity of the original pixel image; a surfacefitting module for fitting said three-dimensional data set by a surface;means for determining the type and degree of the piecewise polynomialinterpolant for surface fitting based on the scaling factor; aresampling module for resampling said binary data representing saidinput pixel image on said fitting surface with weights determined bytype of interpolant, its degree, and scaling factor, to provideinterpolative data; a correction module for correcting any quantizationerror problems in said interpolative data; a thresholding module forthresholding said interpolative data to produce binary data representingan output pixel image; and an output module for producing said outputpixel image from said binary data, wherein said output pixel image isscaled from said input pixel image.
 12. The apparatus of claim 11,wherein said interpolant is a B-spline tensor product surface.
 13. Theapparatus of claim 11, wherein said interpolant is a Beta-spline tensorproduct surface.
 14. The apparatus of claim 11, further comprising:meansfor phase shifting during said resampling step to realign said samplinglocation with respect to said scaling factor.
 15. The apparatus of claim14, further comprising:means for determining the amount of phaseshifting for solving the quantization error problem.
 16. The apparatusof claim 11, further comprising:means for determining threshold valuesthat are used to produce binary output pixels.
 17. The apparatus ofclaim 11, further comprising:means for determining values that are usedto control weights of neighboring input pixels; means forpre-calculating said weights for fixed scaling factors; and means forperforming a convolution by table lookup.
 18. The apparatus of claim 17,further comprising:means for fine tuning said table lookup.
 19. Theapparatus of claim 18, further comprising:means for reducing tablelookup size by the locality detected in said convolution kernels; meansfor reducing table lookup size by the symmetry detected in saidconvolution kernels; and means for reducing table lookup size by keepingonly the most dominant entries of the convolution kernels.
 20. Theapparatus of claim 18, further comprising:means for manually modifyingthe entries of the lookup table, whereby aliasing artifacts aresubstantially removed.